package net.sync.disruptor.demo1;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 第三个消费者
 */
public class Handler3 implements EventHandler<MyEvent>, WorkHandler<MyEvent> {
    private static final Logger log = LoggerFactory.getLogger(Handler3.class);

    @Override
    public void onEvent(MyEvent event) throws Exception {
        log.debug(event.getName() + "====Handler3........");
        event.getCountDownLatch().countDown();
    }

    @Override
    public void onEvent(MyEvent event, long sequence, boolean endOfBatch)
            throws Exception {
        onEvent(event);
    }

}
